package IO流;

import java.io.BufferedWriter;
import java.io.FileWriter;

public class BufferedWriter1 {
    public static void main(String[] args) {
        FileWriter fw=null;
        BufferedWriter bw=null;
        try {
            fw=new FileWriter("e:/a.txt",true);//true等于追加，不写 等于
            bw=new BufferedWriter(fw);
            bw.write("现在时间是多少");
            bw.newLine();//换行
            bw.write("我是个大傻逼");
            bw.flush();
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            try {
                if (bw!=null)bw.close();
                if (fw!=null)fw.close();
            }catch (Exception e){
                e.printStackTrace();
            }
        }
    }
}
